//
//  SmallScrollView.m
//  HWUI06_UIScrollView嵌套，相册
//
//  Created by 崔将军 on 16/3/19.
//  Copyright © 2016年 崔将军. All rights reserved.
//

#import "SmallScrollView.h"


@implementation SmallScrollView

- (void)dealloc
{
    [_imageView release];
    [super dealloc];
}

// 自定义初始化
- (instancetype)initWithFrame:(CGRect)frame images:(UIImage *)images {
    
    self = [self initWithFrame:frame];
    
    if (self) {
        
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        self.imageView.image = images;
        [self addSubview:self.imageView];
        [self.imageView release];
    }
    return self;
}

// 重写初始化
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.minimumZoomScale = 0.5;
        self.maximumZoomScale = 3;
        
        self.delegate = self;//设置代理人,自己和自己签
    }
    return self;
}

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
    
    return self.imageView;
}


@end
